package com.whut.mapper;

import com.whut.entity.UserLogin;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserLoginMapper {
    @Select("SELECT * FROM usert WHERE username = #{username}")
    UserLogin findByUsername(String username);

    @Select("SELECT * FROM usert WHERE email = #{email}")
    UserLogin findByEmail(String email);

    @Update("UPDATE usert SET password = #{password} WHERE email = #{email}")
    boolean updatePassword(UserLogin user);


    @Insert("INSERT INTO usert (username, password, email, birthday,salary ,avatar) VALUES (#{username}, #{password}, #{email}, #{birthday}, 0 ,#{avatar})")
    boolean insertUser(UserLogin user);
}
